<html>
  <head>
    <title>Ubiquity Nountype Tuner</title>
    <link rel="shortcut icon" href="chrome://ubiquity/skin/icons/favicon.ico" type="image/x-icon" />
    <script type="text/javascript;version=1.8" charset='utf-8' src='resource://ubiquity/scripts/jquery.js'></script>
    <script type="text/javascript;version=1.8" 
     src="resource://ubiquity/modules/parser/new/parser.js"></script>
    <script type="text/javascript;version=1.8" charset='utf-8' src='tuner.js'></script>
    <style type="text/css">
			body {
				background-color: #ddd;
				padding: 0px;
				margin: 0px;
				font-family: sans-serif;
			}
			
			h1, h2, h3, .large {
				color: #333;
			}
			
			h2 {
				font-variant: small-caps;
			}

      #main {
        margin: 0 auto;
        width: 800px;
        background-color: #fff;
        padding: 30px;
      }
      
      #border { border: 1px black solid; overflow-x: auto; }
      #border * { display: inline-block }
      input.input {
        border: none;
        width: auto;
        font-size: 0.9em;
        width: 100%;
      }
      
      .warning {
        border: 1px red solid;
        background-color: #ddd;
        padding: 10px;
      }
      
      table#suggs td {
        border-bottom: 1px solid #ccc;
        padding: 0px;
        margin: 0px;
      }
      
      tr {
        padding: 0px;
        margin: 0px;
      }
      
      tbody {
        font-size: 0.7em;
      }
      
      td.id,td.sugg {
        width: 100px;
        overflow:none;
      }
      
      td.score {
        width: 500px;
        background-image: url(resource://ubiquity/chrome/skin/icons/tuner-scale.png);
        background-repeat: repeat-y;
      }
      
      .scorebar {
        display: inline-block;
        background-color: red;
        height: 0.5em;
        vertical-align: middle;
      }
      
    </style>
  </head>
  <body>
  <div id='main'>
  
    <h1>Ubiquity Nountype Tuner</h1>
    
    <p>This tuner allows you to test different inputs against the active nountypes and verify their suggestions. It is particularly helpful for developers to get a sense for how to tweak their nountype suggestions' scores.</p>
    
    <div class='warning' id='parser2' style='display:none'>You're not using Parser 2! The nountype tuner currently only works with Parser 2. Please <a href='chrome://ubiquity/content/settings.xhtml'>turn on Parser 2 (aka Next Generation Parser)</a>, restart Firefox, and try again.</div>

    <div class='warning' id='gubiquity' style='display:none'><code>gUbiquity</code> was not loaded properly. Most likely this means you loaded this page at the same time that you loaded the window, and this page loaded before the window chrome, in which case you can just reload this page and it should work. Otherwise, there may actually be a problem with some code.</div>
    
    <h2>Settings</h2>
    
    <div>
      <!--<input type='button' name='clearnouncache' value='clear noun cache' id='clearnouncache'></input>-->
      <label for='maxSuggestions'>max suggestions per nountype:</label><input id='maxSuggestions' value='5' size='2'/>
      <!--<input type='checkbox' name='noexternalcalls' id='noexternalcalls'></input><label for='noexternalcalls'>only nountypes with no external calls</label>-->
      <input type='checkbox' name='autorun' id='autorun'></input><label for='autorun'>automatically run on update</label>
      <br/>
      <label for='gu-sync'
       title="uses the same parser as the current Ubiquity instance">
       <input type='checkbox' id='gu-sync' checked='checked'/>
       sync with <code>gUbiquity</code>
      </label>
    </div>
    
		<div id='border'>
			<input id='root' class='input'/>
		</div>
		
		<input type='button' id='run' value='run!'></input>

    <h2>Suggestions</h2>
    
    <table id="suggs" border='0'>
    <thead>
      <tr><th>nountype</th><th>suggestion</th><th><img src='resource://ubiquity/chrome/skin/icons/tuner-top.png'></th></tr>
    </thead>
    <tbody>
    </tbody>
    </table>

  </div>
  </body>
</html>
